package com.alibaba.citrus.ots.sales.plan.repository;

import com.alibaba.citrus.ots.sales.plan.dto.api.request.PageQueryPlanAdjustDetailRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.QueryPlanAdjustDetailRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.SalesPlanAdjustDetailBatchQueryRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.SalesPlanAdjustDetailSubTotalRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.response.SalesPlanAdjustDetailSubTotalResponse;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanAdjustDetailSDO;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanLineSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.sdk.model.Result;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author yuhailin
 * @description:
 * @date 2021-10-25 21:08
 */
public interface SalesPlanAdjustDetailRepository {

    /**
     * 分页查询月度计划调整明细
     *
     * @param pageQueryPlanAdjustDetailRequest
     * @return
     */
    PageResult<List<SalesPlanAdjustDetailSDO>> pageQuerySalesPlanAdjustDetailList(PageQueryPlanAdjustDetailRequest pageQueryPlanAdjustDetailRequest);

    /**
     * 批量添加调整明细
     *
     * @param salesPlanAdjustDetailSDOList
     * @return
     */
    String batchCreateSalesPlanAdjustDetail(List<SalesPlanAdjustDetailSDO> salesPlanAdjustDetailSDOList);

    /**
     * 月度计划调整明细小计：
     *
     * @param salesPlanAdjustDetailSubTotalRequest
     * @return
     */
    SalesPlanAdjustDetailSubTotalResponse subTotalSalesPlanAdjustDetail(SalesPlanAdjustDetailSubTotalRequest salesPlanAdjustDetailSubTotalRequest);

    /**
     * 月度计划调整明细完成度占比
     *
     * @param salesPlanAdjustDetailSubTotalRequest
     * @return
     */
    BigDecimal queryCompletePercent(SalesPlanAdjustDetailSubTotalRequest salesPlanAdjustDetailSubTotalRequest);

    /**
     * 编辑明细  - 失去焦点保存
     * @param salesPlanAdjustDetailSDO
     * @return
     */
    Integer edit(SalesPlanAdjustDetailSDO salesPlanAdjustDetailSDO);

    /**
     * 根据ID查询月度计划调整明细
     * @param queryPlanAdjustDetailRequest
     * @return
     */
    SalesPlanAdjustDetailSDO querySalesPlanAdjustDetailList(QueryPlanAdjustDetailRequest queryPlanAdjustDetailRequest);

    /**
     * 根据ids批量查询调整明细
     * @param salesPlanAdjustDetailSDOList
     * @return
     */
    List<SalesPlanAdjustDetailSDO> batchQueryDetail(SalesPlanAdjustDetailBatchQueryRequest salesPlanAdjustDetailSDOList);

    /**
     * 批量删除调整明细(状态变更)
     * @param salesPlanAdjustDetailSDOList
     * @return
     */
    Integer batchUpdateAdjustDetailStatus(List<SalesPlanAdjustDetailSDO> salesPlanAdjustDetailSDOList);
}
